const { merge } = require('webpack-merge');
const webpack = require('webpack');
const baseConfig = require('./webpack.base');
module.exports = merge(baseConfig, {
  // target: 'web',
  mode: 'development',
  devtool: 'source-map',
  devServer: {
    port: 3000,
    // hot: true, // 模块热替换，如果热替换失败就自动回到页面自动刷新
    // hotOnly: true, // 模块热替换，如果热替换失败不会自动刷新页面便于定位问题
    // historyApiFallback: true,
    // proxy: {
    //   '/api': {
    //     target: 'http://localhost:4001',
    //     pathRewrite: { '^/api': '' },
    //     secure: false,
    //     changeOrigin: true,
    //   },
    // },
  },

  plugins: [new webpack.HotModuleReplacementPlugin()],
});
